/*
 * File      : geo_view.h
 * Change Logs:
 * Date           Author       Notes
 * 2013-07-30    jimmy.lee    first version
 */

#ifndef __GEO_XXX_H__
#define __GEO_XXX_H__

#include <rtgui/rtgui.h>
#include <rtgui/widgets/window.h>
#include "geo_cbar.h"
#include "geo_list.h"
#include "geo_menu.h"

#ifdef __cplusplus
extern "C" {
#endif

DECLARE_CLASS_TYPE(geoview);
// Gets the type of a view
#define GEO_VIEW_TYPE      (RTGUI_TYPE(geoview))
// Casts the object to a view
#define GEO_VIEW(obj)      (RTGUI_OBJECT_CAST((obj), GEO_VIEW_TYPE, geo_view_t))
// Checks if the object is a view
#define IS_GEO_VIEW(obj)   (RTGUI_OBJECT_CHECK_TYPE((obj), GEO_VIEW_TYPE))

struct geo_view
{
	struct rtgui_win parent;
	struct rtgui_win *pop_win;
	struct geo_cbar *cbar;
	struct geo_list *list;
};

typedef struct geo_view geo_view_t;

typedef rtgui_win_t *(*geo_view_loader_t)(struct rtgui_win *parent_win, void *parameter);

rt_bool_t load_view(struct rtgui_object *object, geo_view_loader_t loader);



rtgui_win_t *geo_view_home(void *parameter);
struct rtgui_win *geo_view_prjs(struct rtgui_win *parent_win, void *parameter);
rtgui_win_t *geo_view_rgns(void *parameter);
rtgui_win_t *geo_view_test(void *parameter);
rtgui_win_t *geo_view_data(void *parameter);
//rtgui_win_t *geo_demo_home(void *parameter);

rt_bool_t _menu_navigation_on_pop(struct rtgui_object *object, void *args);
struct geo_view *geo_view_create(
struct geo_items *list_items,
struct geo_items *cbar_items,
struct geo_items *menu_items);
rt_bool_t geo_view_menu_on_pop(struct rtgui_win *parent_win, struct geo_items *menu_items);

rt_bool_t geo_load_view(struct rtgui_object *object, void *args);


#ifdef __cplusplus
}
#endif

#endif